.class public Lcom/netease/netstat/statistics/CellLocationTest;
.super Lcom/netease/netstat/statistics/BaseTest;
.source "CellLocationTest.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/netease/netstat/statistics/CellLocationTest$MyPhoneStateListen;
    }
.end annotation


# instance fields
.field private mystatelisten:Lcom/netease/netstat/statistics/CellLocationTest$MyPhoneStateListen;


# direct methods
.method public constructor <init>(Landroid/telephony/TelephonyManager;Landroid/net/ConnectivityManager;Lcom/netease/netstat/utils/FileService;)V
    .locals 0
    .parameter "telephony"
    .parameter "connectivity"
    .parameter "file"

    .prologue
    .line 20
    invoke-direct {p0, p1, p2, p3}, Lcom/netease/netstat/statistics/BaseTest;-><init>(Landroid/telephony/TelephonyManager;Landroid/net/ConnectivityManager;Lcom/netease/netstat/utils/FileService;)V

    .line 21
    return-void
.end method


# virtual methods
.method public getLocation()V
    .locals 6

    .prologue
    const/4 v5, 0x5

    .line 30
    const/4 v0, 0x1

    .line 31
    .local v0, cdma:Z
    :try_start_0
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getSubscriberId()Ljava/lang/String;

    move-result-object v3

    const-string v4, "46000"

    invoke-virtual {v3, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_0

    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getSubscriberId()Ljava/lang/String;

    move-result-object v3

    const-string v4, "46001"

    invoke-virtual {v3, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_0

    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getSubscriberId()Ljava/lang/String;

    move-result-object v3

    const-string v4, "46002"

    invoke-virtual {v3, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 32
    :cond_0
    const/4 v0, 0x0

    .line 36
    :cond_1
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    if-eqz v3, :cond_6

    sget-boolean v3, Lcom/netease/netstat/utils/Contanst;->airline:Z

    if-nez v3, :cond_6

    .line 37
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getSimState()I

    move-result v3

    const/4 v4, 0x1

    if-eq v3, v4, :cond_6

    .line 38
    if-nez v0, :cond_6

    .line 39
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;

    move-result-object v3

    if-eqz v3, :cond_6

    .line 42
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    .line 43
    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getCellLocation()Landroid/telephony/CellLocation;

    move-result-object v2

    .line 42
    check-cast v2, Landroid/telephony/gsm/GsmCellLocation;

    .line 44
    .local v2, location:Landroid/telephony/gsm/GsmCellLocation;
    if-eqz v2, :cond_3

    .line 46
    invoke-virtual {v2}, Landroid/telephony/gsm/GsmCellLocation;->getCid()I

    move-result v3

    if-lez v3, :cond_2

    .line 47
    invoke-virtual {v2}, Landroid/telephony/gsm/GsmCellLocation;->getCid()I

    move-result v3

    invoke-static {v3}, Lcom/netease/netstat/utils/Contanst;->setCellId(I)V

    .line 49
    :cond_2
    invoke-virtual {v2}, Landroid/telephony/gsm/GsmCellLocation;->getLac()I

    move-result v3

    if-lez v3, :cond_3

    .line 50
    invoke-virtual {v2}, Landroid/telephony/gsm/GsmCellLocation;->getLac()I

    move-result v3

    invoke-static {v3}, Lcom/netease/netstat/utils/Contanst;->setCellLoc(I)V

    .line 53
    :cond_3
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v3

    if-le v3, v5, :cond_4

    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;

    move-result-object v3

    .line 54
    const/4 v4, 0x0

    const/4 v5, 0x3

    invoke-virtual {v3, v4, v5}, Ljava/lang/String;->subSequence(II)Ljava/lang/CharSequence;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    .line 53
    invoke-static {v3}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I

    move-result v3

    if-lez v3, :cond_4

    .line 56
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    .line 57
    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x0

    const/4 v5, 0x3

    invoke-virtual {v3, v4, v5}, Ljava/lang/String;->subSequence(II)Ljava/lang/CharSequence;

    move-result-object v3

    .line 56
    check-cast v3, Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I

    move-result v3

    invoke-static {v3}, Lcom/netease/netstat/utils/Contanst;->setMcc(I)V

    .line 59
    :cond_4
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x3

    const/4 v5, 0x5

    invoke-virtual {v3, v4, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I

    move-result v3

    if-lez v3, :cond_5

    .line 60
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;

    move-result-object v3

    .line 61
    const/4 v4, 0x3

    const/4 v5, 0x5

    invoke-virtual {v3, v4, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    .line 60
    invoke-static {v3}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I

    move-result v3

    invoke-static {v3}, Lcom/netease/netstat/utils/Contanst;->setMnc(I)V

    .line 64
    :cond_5
    new-instance v3, Lcom/netease/netstat/statistics/CellLocationTest$MyPhoneStateListen;

    const/4 v4, 0x0

    invoke-direct {v3, p0, v4}, Lcom/netease/netstat/statistics/CellLocationTest$MyPhoneStateListen;-><init>(Lcom/netease/netstat/statistics/CellLocationTest;Lcom/netease/netstat/statistics/CellLocationTest$MyPhoneStateListen;)V

    iput-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->mystatelisten:Lcom/netease/netstat/statistics/CellLocationTest$MyPhoneStateListen;

    .line 65
    iget-object v3, p0, Lcom/netease/netstat/statistics/CellLocationTest;->telephony:Landroid/telephony/TelephonyManager;

    iget-object v4, p0, Lcom/netease/netstat/statistics/CellLocationTest;->mystatelisten:Lcom/netease/netstat/statistics/CellLocationTest$MyPhoneStateListen;

    .line 66
    const/16 v5, 0x100

    .line 65
    invoke-virtual {v3, v4, v5}, Landroid/telephony/TelephonyManager;->listen(Landroid/telephony/PhoneStateListener;I)V
    :try_end_0
    .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 95
    .end local v2           #location:Landroid/telephony/gsm/GsmCellLocation;
    :cond_6
    :goto_0
    return-void

    .line 86
    :catch_0
    move-exception v1

    .line 88
    .local v1, e:Ljava/lang/NumberFormatException;
    invoke-virtual {v1}, Ljava/lang/NumberFormatException;->printStackTrace()V

    goto :goto_0

    .line 89
    .end local v1           #e:Ljava/lang/NumberFormatException;
    :catch_1
    move-exception v1

    .line 91
    .local v1, e:Ljava/lang/Exception;
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method
